package net.amsoft.iservice.icontact.hibernate;

import java.util.Date;

import net.amsoft.iservice.icontact.util.IContactConstants;

public class IContactObject {
    protected Long id;
    protected Date creationTime;
    protected Date modificationTime;
    protected int state;

    public Long getId() {
        return id;
    }

    private void setId(Long id) {
        this.id = id;
    }

    public Date getCreationTime() {
        return this.creationTime;
    }

    protected void setCreationTime(Date creationTime) {
        this.creationTime = creationTime;
    }

    public Date getModificationTime() {
        return this.modificationTime;
    }

    protected void setModificationTime(Date modificationTime) {
        this.modificationTime = modificationTime;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public IContactObject insert() {
        this.setCreationTime(new Date());
        this.setModificationTime(new Date());
        this.setState(IContactConstants.ACTIVE);
        return (this);
    }

    public IContactObject update() {
        this.setModificationTime(new Date());
        return (this);
    }

    public IContactObject remove() {
        this.setState(IContactConstants.INACTIVE);
        return (this);
    }
}
